<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .d1,.d2,.d3{
            border: 1px solid #000;
        }
        .d1{
            width: 200px;
            height: 200px;
        }
        .d2{
            width: 100px;
            height: 100px;
        }
        .d3{
            width: 50px;
            height: 50px;
        }
    </style>
</head>
<body>
    <div id="app">
        <input type="text" @keyup.a="print()">
        <input type="text" @keyup.enter="print()">
        <hr>

        <!-- 
            事件传播，两种方式：
                1.事件冒泡（默认）
                2.事件捕获
         -->
        <div class="d1" @click.capture="write('div1')">div1
            <div class="d2" @click.capture.stop.self="write('div2')">div2
                <div class="d3" @click.capture="write('div3')">div3</div>
            </div>
        </div>

        <a href="javascript:;" @click.once="print()">点我</a>
        <a href="http://www.baidu.com" @click.prevent="print()">点我</a>
    </div>
</body>
<script>
    var vm = new Vue({
        el:'#app',
        data:{ 
            
        },
        methods: { 
            print(){
                console.log(111)
            },
            write(args){
                console.log(args)
            }
        },
    })
</script>
</html>